# -*- coding: utf-8 -*-
"""
@Time ： 2023/10/9 12:42
@Auth ： y.h
@File ：get_sheet_data_value_entity.py
@IDE ：PyCharm
@Motto：The sooner you start to code, the longer the program will take. —— Roy Carlson
"""



class 数据裁切配置文件:
    """
    获取指定列表内指定索引的值
    """
    __file_name: str = None
    __sheet_name: str = None
    __col_index_list: list = []
    __line_index_list: list = []

    __col_begin_index = 0
    __col_end_index = 0

    __row_begin_index = 0
    __row_end_index = 0

    def get_file_name(self):
        return self.__file_name

    def 配置文件名(self, file_name: str):
        print(type(file_name))
        if len(file_name) < 1:
            return self
        else:
            self.__file_name = file_name
            return self

    def get_sheet_name(self):
        return self.__sheet_name

    def 配置表单名(self, sheet_name: str):
        if len(sheet_name) < 1:
            return self
        else:
            self.__sheet_name = sheet_name
            return self

    def get_col_index_list(self):

        return self.__col_index_list

    def 配置列索引(self, col_index):
        self.__col_index_list = []
        if type(col_index) == type(list()):
            self.__col_index_list.extend(col_index)
        else:
            self.__col_index_list.append(col_index)
        return self

    def get_line_index_list(self):
        return self.__line_index_list

    def 配置行索引(self, line_index):
        self.__line_index_list = []
        if type(line_index) == type(list()):
            self.__line_index_list.extend(line_index)
        else:
            self.__line_index_list.append(line_index)
        return self

    def get_col_begin_index(self):
        return self.__col_begin_index

    def 配置数据裁切起始列(self, begin_index):
        if type(begin_index) != type(int()):
            print(f"数据裁切配置文件->配置数据裁切起始列参数错误,需要一个{type(int())},参数类型为{type(begin_index)}")
            exit(True)
        else:
            self.__col_begin_index = begin_index
        return self

    def get_col_end_index(self):
        return self.__col_end_index

    def 配置数据裁切截止列(self, end_index):
        if type(end_index) != type(int()):
            print(f"数据裁切配置文件->配置数据裁切截止列参数错误,需要一个{type(int())},参数类型为{type(end_index)}")
            exit(True)
        else:
            self.__col_end_index = end_index
        return self

    def get_row_begin_index(self):
        return self.__row_begin_index

    def 配置数据裁切起始行(self, begin_index):
        if type(begin_index) != type(int()):
            print(f"数据裁切配置文件->配置数据裁切起始行参数错误,需要一个{type(int())},参数类型为{type(begin_index)}")
            exit(True)
        else:
            self.__row_begin_index = begin_index
        return self

    def get_row_end_index(self):
        return self.__row_end_index

    def 配置数据裁切截止行(self, end_index):
        if type(end_index) != type(int()):
            print(f"数据裁切配置文件->配置数据裁切截止行参数错误,需要一个{type(int())},参数类型为{type(end_index)}")
            exit(True)
        else:
            self.__row_end_index = end_index
        return self
